// Received 5169409 | 10372481 / 24bit Protocol: 1  解锁
// Received 5169412 | 10372484 / 24bit Protocol: 1  上电
// Received 5169410 | 10372482 / 24bit Protocol: 1  上锁

let hex = "9e 45 82";

let hexArray = hex.split(" ");

let binArray = hexArray.map(hex => parseInt(hex, 16).toString(2).padStart(8, "0"));

let bin = binArray.join("");

let code = 0;
for (let i = 0; i < bin.length; i++) {
    code <<= 1;

    if (bin[i] == 1) {
        code |= 1;
    }
}

console.log("bin", bin);
console.log("code", code);